package com.cjr.service;

import com.cjr.pojo.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cjr.vo.LoginVo;
import com.cjr.vo.RespBean;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * user service interface
 *
 * @author cjr
 */
public interface IUserService extends IService<User> {

    /**
     * login
     *
     * @param loginVo
     * @param request
     * @param response
     * @return
     */
    RespBean doLogin(LoginVo loginVo, HttpServletRequest request, HttpServletResponse response);

    /**
     * get user by cookie
     *
     * @param userTicket
     * @param request
     * @param response
     * @return
     */
    User getUserByCookie(String userTicket, HttpServletRequest request, HttpServletResponse response);

    /**
     * update user password
     * @param userTicket
     * @param password
     * @param request
     * @param response
     * @return
     */
    RespBean updatePassword(String userTicket, String password,
                            HttpServletRequest request, HttpServletResponse response);
}
